layui.use(['form','layer','laydate','table','laytpl'],function(){
    var form = layui.form,
        layer = parent.layer === undefined ? layui.layer : parent.layer,
        $ = layui.jquery,
        laydate = layui.laydate,
        laytpl = layui.laytpl,
        table = layui.table;

    //用户
    table.render({
        elem: '#logList',
        url : '/log/sysLog/list',
        cellMinWidth : 95,
        page : true,
        height : "full-98",
        limits : [10,15,20,25],
        id : "logListTable",
        cols : [[
            {field: 'id', title: 'ID', width:100, align:"center"},
            {field: 'username', title: '用户名', width:150},
            {field: 'operation', title: '用户操作', align:'center'},
            {field: 'method', title: '请求方法',  align:'center'},
            {field: 'params', title: '请求参数', align:'center'},
            {field: 'time', title: '执行时长(毫秒)', align:'center'},
            {field: 'ip', title: 'ip', align:'center'},
            {field: 'createDate', title: '创建时间', align:'center'}
        ]]
    });
    //搜索
    $(".search_btn").on("click",function(){
        table.reload("logListTable",{
            page: {
                curr: 1 //重新从第 1 页开始
            },
            where: {
                key : $(".searchVal").val()

            }
        })
    });
})